<?php

namespace App\Http\Requests\Api;

class RedeemLogRequest extends Request
{
    public function rules()
    {
        switch($this->method())
        {
            switch($this->method()) {

            case 'POST':
                return [
                    'prize_id' => 'required|exists:prizes,id',
                    'user_id' => 'exists:user,id',
                    'filiale_id' => 'required|exists:filiale,id',
                ];
                break;

            case 'PATCH':
                return [
                    'prize_id' => 'exists:prizes,id',
                    'user_id' => 'exists:user,id',
                    'filiale_id' => 'exists:filiale,id',
                ];
                break;
        }
        }
    }

    public function messages()
    {
        return [
            'prize_id' => '奖品id',
            'user_id' => '用户id',
            'filiale_id' => '商家分店id',
        ];
    }
}
